<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/16
 * Time: 11:06
 */
session_start();
$key=$_COOKIE['taken'];
if(empty($_SESSION[$key])){
    echo '未登录，请登录<br/><a href="../admin/admin_login.php">登陆</a>';
    die();
}
echo '用户列表';
//与数据库建立连接
$conn=new  mysqli('127.0.0.1','root','root','bank');
//查询数据库用户语句
$sql="select * from accountinfo";
$result=$conn->query($sql);
$data=[];
?>
<!<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>用户列表</title>
</head>
<body>
    <table border="1" cellspacing="0" cellpadding="0">
        <tr>
            <th>AccountId</th>
            <th>AccountCode</th>
            <th>AccountPhone</th>
            <th>RealName</th>
            <th>OpenTime</th>
        </tr>
        <?php
        for ($i=0;$i<$conn->affected_rows;$i++){
            $data[$i]=$result->fetch_assoc();
            ?>
            <tr>
                <td><?php echo $data[$i]['AccountId'] ?></td>
                <td><?php echo $data[$i]['AccountCode'] ?></td>
                <td><?php echo $data[$i]['AccountPhone'] ?></td>
                <td><?php echo $data[$i]['RealName'] ?></td>
                <td><?php echo $data[$i]['OpenTime'] ?></td>
            </tr>
        <?php
        }
        ?>
    </table>
    <?php
    echo '<br/><a href="../admin/adminlogin_action.php">返回</a>';
    ?>
</body>
</html>
